package com.museum.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.museum.entity.DO.DataProcess;
import com.museum.entity.DO.RegisterProcess;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yznl
 * @since 2021-03-10
 */
public interface DataProcessMapper extends BaseMapper<DataProcess> {
    @Select("select status from data_process where id = #{clueId}")
    Integer getStatus(int clueId);
    @Select("select count(*) from data_process where operate_status = 0 and id = #{clueId}")
    boolean isOperateStauts(int clueId);
    @Select("select * from data_process where id = #{id}")
    DataProcess selectProcessById(Integer id);
    @Update("update data_process set operate_status = #{status} where id = #{id}")
    int commitCol(Integer status, Integer id);
    @Update("update data_process set operate_desc = #{operate_desc} where id = #{id}")
    int updateOperateDesc(String operate_desc, Integer id);
    @Update("update data_process set second_status = #{status} where id = #{id}")
    int commitColPrice(Integer id, Integer status);
    @Select("select count(*) from data_process where operate_status = 1 and id = #{clueId}")
    boolean isOperateStauts2(int clueId);
    @Select("select count(*) from data_process where second_status = 1 and id = #{clueId}")
    boolean isPriceStauts(int clueId);
    @Select("select count(*) from data_process where third_status = 0 and id = #{clueId}")
    boolean isSecondStauts(int clueId);
}
